Optimal. Leaf size=35 \[ \frac{1}{\sqrt{a \sec ^2(x)}}-\frac{\tanh ^{-1}\left (\frac{\sqrt{a \sec ^2(x)}}{\sqrt{a}}\right )}{\sqrt{a}} \]
[Out]
________________________________________________________________________________________
Rubi [A] time = 0.0796105, antiderivative size = 35, normalized size of antiderivative = 1., number of steps used = 5, number of rules used = 5, integrand size = 15, \(\frac{\text{number of rules}}{\text{integrand size}}\) = 0.333, Rules used = {3657, 4124, 51, 63, 207} \[ \frac{1}{\sqrt{a \sec ^2(x)}}-\frac{\tanh ^{-1}\left (\frac{\sqrt{a \sec ^2(x)}}{\sqrt{a}}\right )}{\sqrt{a}} \]
Antiderivative was successfully verified.
[In]
[Out]
Rule 3657
Rule 4124
Rule 51
Rule 63
Rule 207
Rubi steps
\begin{align*} \int \frac{\cot (x)}{\sqrt{a+a \tan ^2(x)}} \, dx &=\int \frac{\cot (x)}{\sqrt{a \sec ^2(x)}} \, dx\\ &=\frac{1}{2} a \operatorname{Subst}\left (\int \frac{1}{(-1+x) (a x)^{3/2}} \, dx,x,\sec ^2(x)\right )\\ &=\frac{1}{\sqrt{a \sec ^2(x)}}+\frac{1}{2} \operatorname{Subst}\left (\int \frac{1}{(-1+x) \sqrt{a x}} \, dx,x,\sec ^2(x)\right )\\ &=\frac{1}{\sqrt{a \sec ^2(x)}}+\frac{\operatorname{Subst}\left (\int \frac{1}{-1+\frac{x^2}{a}} \, dx,x,\sqrt{a \sec ^2(x)}\right )}{a}\\ &=-\frac{\tanh ^{-1}\left (\frac{\sqrt{a \sec ^2(x)}}{\sqrt{a}}\right )}{\sqrt{a}}+\frac{1}{\sqrt{a \sec ^2(x)}}\\ \end{align*}
Mathematica [A] time = 0.0328115, size = 32, normalized size = 0.91 \[ \frac{\sec (x) \left (\cos (x)+\log \left (\sin \left (\frac{x}{2}\right )\right )-\log \left (\cos \left (\frac{x}{2}\right )\right )\right )}{\sqrt{a \sec ^2(x)}} \]
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
Maple [A] time = 0.079, size = 29, normalized size = 0.8 \begin{align*}{\frac{1}{\cos \left ( x \right ) } \left ( \cos \left ( x \right ) +\ln \left ( -{\frac{\cos \left ( x \right ) -1}{\sin \left ( x \right ) }} \right ) +1 \right ){\frac{1}{\sqrt{{\frac{a}{ \left ( \cos \left ( x \right ) \right ) ^{2}}}}}}} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Maxima [A] time = 1.92286, size = 57, normalized size = 1.63 \begin{align*} \frac{2 \, \cos \left (x\right ) - \log \left (\cos \left (x\right )^{2} + \sin \left (x\right )^{2} + 2 \, \cos \left (x\right ) + 1\right ) + \log \left (\cos \left (x\right )^{2} + \sin \left (x\right )^{2} - 2 \, \cos \left (x\right ) + 1\right )}{2 \, \sqrt{a}} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Fricas [B] time = 1.40237, size = 186, normalized size = 5.31 \begin{align*} \frac{{\left (\tan \left (x\right )^{2} + 1\right )} \sqrt{a} \log \left (\frac{a \tan \left (x\right )^{2} - 2 \, \sqrt{a \tan \left (x\right )^{2} + a} \sqrt{a} + 2 \, a}{\tan \left (x\right )^{2}}\right ) + 2 \, \sqrt{a \tan \left (x\right )^{2} + a}}{2 \,{\left (a \tan \left (x\right )^{2} + a\right )}} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Sympy [F] time = 0., size = 0, normalized size = 0. \begin{align*} \int \frac{\cot{\left (x \right )}}{\sqrt{a \left (\tan ^{2}{\left (x \right )} + 1\right )}}\, dx \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Giac [A] time = 1.0731, size = 58, normalized size = 1.66 \begin{align*} a{\left (\frac{\arctan \left (\frac{\sqrt{a \tan \left (x\right )^{2} + a}}{\sqrt{-a}}\right )}{\sqrt{-a} a} + \frac{1}{\sqrt{a \tan \left (x\right )^{2} + a} a}\right )} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]